/* $Id: NonClientCompanyDomainObjectManagerImpl.java 
 * Copyright (C) 2011, TRAKHEES
 *  
 * Revision History
 *
 * Date  			Author 		    	Remarks
 * ---------------------------------------------------------------------------------
 *
 */
package ae.pcfc.etks.online.common.domain.manager.provider;

import java.util.Collection;

import ae.pcfc.etks.online.common.dao.NonClientCompanyDAO;
import ae.pcfc.etks.online.common.domain.ClientCompanyReq;
import ae.pcfc.etks.online.common.domain.ClientCompanyRoleReq;
import ae.pcfc.etks.online.common.domain.manager.NonClientCompanyDomainObjectManager;
import ae.pcfc.etks.online.common.exception.LookupException;
import ae.pcfc.etks.online.common.exception.PersistenceException;
import ae.pcfc.etks.online.common.vo.LicenseVO;

public class NonClientCompanyDomainObjectManagerImpl implements NonClientCompanyDomainObjectManager {

	private NonClientCompanyDAO nonClientCompanyDAO;

	/**
	 * setNonClientCompanyDAO
	 * 
	 * @param nonClientCompanyDAO
	 * void
	 */
	public void setNonClientCompanyDAO(NonClientCompanyDAO nonClientCompanyDAO) {
		this.nonClientCompanyDAO = nonClientCompanyDAO;
	}

	/**
	 * add
	 * 
	 * @see ae.pcfc.etks.online.common.domain.manager.NonClientCompanyDomainObjectManager#add(ae.pcfc.etks.online.common.domain.ClientCompanyReq)
	 * 
	 */
	public String add(ClientCompanyReq clientCompanyReq) throws PersistenceException {

		// As we are storing the client roles as well so, for that we need to
		// set the Client Person in it
		for (ClientCompanyRoleReq companyRoleReq : clientCompanyReq.getClientCompanyRoleReqs()) {
			companyRoleReq.setCCompanyReq(clientCompanyReq);
		}
		return nonClientCompanyDAO.add(clientCompanyReq);
	}

	/**
	 * add
	 * 
	 * @see ae.pcfc.etks.online.common.domain.manager.BaseDomainObjectManager#add(java.lang.Object)
	 * 
	 */
	public <T> void add(T obj) throws PersistenceException {

		// nonClientCompanyDAO.add((CCompanyReq)obj);
	}

	/**
	 * update
	 * 
	 * @see ae.pcfc.etks.online.common.domain.manager.BaseDomainObjectManager#update(java.lang.Object)
	 * 
	 */
	public <T> void update(T obj) throws PersistenceException {
		// TODO Auto-generated method stub

	}

	/**
	 * delete
	 * 
	 * @see ae.pcfc.etks.online.common.domain.manager.BaseDomainObjectManager#delete(java.lang.Object)
	 * 
	 */
	public <T> void delete(T obj) throws PersistenceException {
		// TODO Auto-generated method stub

	}

	/**
	 * findByPrimaryKey
	 * 
	 * @see ae.pcfc.etks.online.common.domain.manager.BaseDomainObjectManager#findByPrimaryKey(java.lang.String)
	 * 
	 */
	public <T> T findByPrimaryKey(String id) throws LookupException {
		// TODO Auto-generated method stub
		return null;
	}

	/**
	 * findAll
	 * 
	 * @see ae.pcfc.etks.online.common.domain.manager.BaseDomainObjectManager#findAll()
	 * 
	 */
	public <T> Collection<T> findAll() throws LookupException {
		// TODO Auto-generated method stub
		return null;
	}

	/**
	 * getNonClientCompanyByApplicationId
	 * 
	 * @see ae.pcfc.etks.online.common.domain.manager.NonClientCompanyDomainObjectManager#getNonClientCompanyByApplicationId(java.lang.String)
	 * 
	 */
	public ClientCompanyReq getNonClientCompanyByApplicationId(String applicationId) throws LookupException {

		return nonClientCompanyDAO.getNonClientCompanyByApplicationId(applicationId);
	}

	/**
	 * validateLicenseReq
	 * 
	 * @see ae.pcfc.etks.online.common.domain.manager.NonClientCompanyDomainObjectManager#validateLicenseReq(ae.pcfc.etks.online.common.vo.LicenseVO)
	 * 
	 */
	public boolean validateLicenseReq(LicenseVO licenseVO) throws LookupException {

		return this.nonClientCompanyDAO.validateLicenseReq(licenseVO);
	}

	/**
	 * getNonClientCompanyByEmail
	 * 
	 * @see ae.pcfc.etks.online.common.domain.manager.NonClientCompanyDomainObjectManager#getNonClientCompanyByEmail(java.lang.String)
	 * 
	 */
	public ClientCompanyReq getNonClientCompanyByEmail(String email) {
		return this.nonClientCompanyDAO.getNonClientCompanyByEmail(email);
	}

	/**
	 * getNonClientCompanyByPropertyName
	 * 
	 * @see ae.pcfc.etks.online.common.domain.manager.NonClientCompanyDomainObjectManager#getNonClientCompanyByPropertyName(java.lang.String, java.lang.String)
	 * 
	 */
	public ClientCompanyReq getNonClientCompanyByPropertyName(String propertyName, String propertyValue) {
		return this.nonClientCompanyDAO.getNonClientCompanyByPropertyName(propertyName, propertyValue);
	}
	/**
	 * validateByPropertyName
	 * 
	 * @see ae.pcfc.etks.online.common.domain.manager.NonClientCompanyDomainObjectManager#validateByPropertyName(java.lang.String, java.lang.String)
	 * 
	 */
	public boolean validateByPropertyName(String strPropertyName,
			String strPropertyValue) {
		return this.nonClientCompanyDAO.validateByPropertyName(strPropertyName, strPropertyValue);
	}

}
